/**
 * Created by chesw on 2017/5/4.
 */
var clinicHead = Vue.extend({
    props: ['userName', 'searchKey', 'borderStyle'],
    data: function () {
        return {
            searchKeys: '',
            item1: '高血压',
            item2: '冠心病',
            item3: '肺癌',
            item4: '胃癌',
            item5: '2型糖尿病',
            item6: '甲状腺功能亢进',
        }
    },
    methods: {
        setSearchKey: function (p_searchKey) {
            var _self = this;
            _self.searchKeys = p_searchKey;
        },
        backToHome: function () {
            window.location.href = "/Home/Index";
        },
        //当前用户登出
        logout: function () {
            this.$http.post("/Home/LoginOut").then(function (res) {
                if (res.body !== null) {
                    RegistBar = document.getElementById("RegistBar");
                    LoginBar = document.getElementById("LoginBar");
                    QkResv = document.getElementById("QkResv");

                    //显示指定的头菜单
                    if (res.body.isLogin === true) {
                        RegistBar.style.display = "none";
                        LoginBar.style.display = "block";
                        QkResv.style.display = "none";
                    }
                    else {
                        RegistBar.style.display = "block";
                        LoginBar.style.display = "none";
                        QkResv.style.display = "block";
                        if (window.location.href.indexOf("PersonalCenter") !== -1)
                            window.location.href = "../Login/Index";
                    }
                }
            });
        },
        keyupsearch: function (ev) {
            if(ev.keyCode==13){
                this.searchInfo(ev)
            }
        },
        searchInfo: function ($event) {
            var _self = this;
            var searchlogitem = $event;
            var searchitem = "";
            if (searchlogitem == "高血压" || searchlogitem == "冠心病" || searchlogitem == "肺癌" || searchlogitem == "胃癌" || searchlogitem == "2型糖尿病" || searchlogitem == "甲状腺功能亢进") {
                searchitem = searchlogitem;
            }
            else {
                searchitem = _self.searchKeys;
            }
            
            window.location.href = encodeURI("/Home/Index?searchKeys=" + searchitem);
            //if (window.location.href.indexOf("/Home/Index") > 0 || window.location.href == "http://" + window.location.host + "/") {
            //    _self.$emit('search', searchitem);
            //}
            //else {
            //window.location.href = encodeURI("/Home/Index?searchKeys=" + searchitem);
            //}
        }
    },
    template: '<header class="out-clinic-head" :class="[borderStyle? \'clinic-head-home\': \'clinic-head-other\']">' +
    '<div class="clinic-head" id="clinic-head">' +
        '<div class="clinic-head-top-right clinic-head-login" id="RegistBar">' +
            '<span><a href="/Login/Index?loginType=log">登录</a></span>' +
            '<span><a href="/Login/Index?loginType=reg">注册</a></span>' +
        '</div>' +
        '<div class="clinic-head-top-right clinic-head-user" id="LoginBar">' +
            '<span style="margin-right:15px">欢迎，{{userName}}</span>' +
            '<span><a class="head-personal-center" href="/PersonalCenter/Index">个人中心</a></span>' +
            '<span><a href="javascript:;" @click="logout()">[退出]</a></span>' +
        '</div>' +
        '<div class="clinic-head-mid">' +
            '<img class="logo" src="/styles/image/logo.png" @click="backToHome()">' +
            '<div class="search">' +
                '<div class="vertical-line"></div>' +
                '<div class="search-inner">' +
                    '<input class="input-search" type="text" v-model="searchKeys" @keyup="keyupsearch($event)">' +
                '</div>' +
               '<div class="search-btn" id="searchinfos"  v-on:click="searchInfo($event)">搜索</div>' +
                '<div class="late-search">' +
                '<span v-on:click="searchInfo(item1)">高血压</span>&nbsp;&nbsp;<span v-on:click="searchInfo(item2)">冠心病</span>&nbsp;&nbsp;<span v-on:click="searchInfo(item3)">肺癌</span>&nbsp;&nbsp;' +
                '<span v-on:click="searchInfo(item4)">胃癌</span>&nbsp;&nbsp;<span v-on:click="searchInfo(item5)">2型糖尿病</span>&nbsp;&nbsp;<span  v-on:click="searchInfo(item6)">甲状腺功能亢进</span></div>' +
            '</div>' +
            '<div class="date-phone">' +
                '<div class="hot-line">免费热线 400-110-8102</div>' +
                '<div class="work-time">周一至周日 8:00-20:00</div>' +
            '</div>' +
        '</div>' +
        '<div class="clinic-head-nav">' +
            '<div class="nav-list" id="nav">' +
                '<a href="/Home/Index" id="Home">首页</a>' +
                '<a href="/OrderExpert/Index" id="OrderExpert">专家预约</a>' +
                '<a href="/DistinctMedical/Index" id="DistinctMedical">特色诊疗</a>' +
                '<a href="/MedicalWiki/Index" id="MedicalWiki">医学百科</a>' +
                '<a href="/News/Index" id="News">最新动态</a>' +
                '<a href="/AboutUs/Index" id="AboutUs">关于我们</a>' +
            '</div>' +
            '<div class="iphone-clinic">' +
                '<img class="img" src="/styles/image/phone_clinic.png">' +
                '<img class="head-qr-code" src="/styles/image/clinic_t.png">' +
            '</div>' +
        '</div>' +
    '</div></header>'
});

//右边操作栏
var clinicRight = Vue.extend({
    props: [],
    data: function () {
        return {
            sResvIntentionTip: '',
            sSuggestTip: '',
            showQkRe: false,
            showSuggest: false,
            QuickResvIntentionInfo: {
                username: '',
                usermobile: '',
                docname: ''
            },
            SuggestInfo: {
                suggestcomments: '',
                suggesttername: '',
                suggesttermobile: ''
            },
            errorType: -1 //错误类型，-1：默认无错误，0：留言错误
        }
    },
    methods: {
        BackToTop: function () {
            document.documentElement.scrollTop = 0;
            document.body.scrollTop = 0;
        },
        CloseQkRe: function () {
            var _self = this;
            _self.showQkRe = false;
            _self.QuickResvIntentionInfo.username = "";
            _self.QuickResvIntentionInfo.usermobile = "";
            _self.QuickResvIntentionInfo.docname = "";
            var tipBox = document.getElementById("ResvIntentiontipBox");
            tipBox.style.display = "none";
            _self.sResvIntentionTip = "";
            _self.errorType = -1;
        },
        CloseSuggest: function () {
            var _self = this;
            _self.showSuggest = false
            _self.SuggestInfo.suggestcomments = "";
            _self.SuggestInfo.suggesttername = "";
            _self.SuggestInfo.suggesttermobile = "";
            var tipBox = document.getElementById("tipBox");
            tipBox.style.display = "none";
            _self.sSuggestTip = "";
            _self.errorType = -1;
        },
        DeleteItem: function ($event) {
            var _self = this;

            var setid = $event.id;
            if (setid == "ResvName") {
                _self.QuickResvIntentionInfo.username = "";
            }
            else if (setid == "ResvUserMobile") {
                _self.QuickResvIntentionInfo.usermobile = "";
            }
            else if (setid == "ResvDocName") {
                _self.QuickResvIntentionInfo.docname = "";
            }
            else if (setid == "SuggestComments") {
                _self.SuggestInfo.suggestcomments = "";
            }
            else if (setid == "SuggestName") {
                _self.SuggestInfo.suggesttername = "";
            }
            else if (setid == "SuggestterMobile") {
                _self.SuggestInfo.suggesttermobile = "";
            }

            $event.value = "";
            $event.nextElementSibling.style.visibility = "hidden";
        },
        ResvIntentionQuickAdd: function () {
            var _self = this;
            var tipBox = document.getElementById("ResvIntentiontipBox");
            tipBox.style.display = "none";

            var username = _self.QuickResvIntentionInfo.username;
            var usermobile = _self.QuickResvIntentionInfo.usermobile;
            var docname = _self.QuickResvIntentionInfo.docname;

            _self.errorType = -1; //每次初始化错误类型
            if (_self.QuickResvIntentionInfo.username == null || _self.QuickResvIntentionInfo.username == "") {
                tipBox.style.display = "block";
                _self.sResvIntentionTip = "请输姓名";
                _self.errorType = 2; 
                return false;
            }
            else if (!(/[\u4E00-\u9FA5]{2,5}(?:·[\u4E00-\u9FA5]{2,5})*/.test(_self.QuickResvIntentionInfo.username))) {
                tipBox.style.display = "block";
                _self.sResvIntentionTip = "请输入正确的姓名";
                _self.errorType = 2;
                return false;
            }
            else if (_self.QuickResvIntentionInfo.usermobile == null || _self.QuickResvIntentionInfo.usermobile == "") {
                tipBox.style.display = "block";
                _self.sResvIntentionTip = "请输手机号";
                _self.errorType = 3;
                return false;
            }
            else if (!(/^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0,5-9]))\d{8}$/.test(_self.QuickResvIntentionInfo.usermobile))) {
                tipBox.style.display = "block";
                _self.sResvIntentionTip = "请输入正确格式的手机号码";
                _self.errorType = 3;
                return false;
            }
            if (_self.QuickResvIntentionInfo.docname == null || _self.QuickResvIntentionInfo.docname == "") {
                tipBox.style.display = "block";
                _self.sResvIntentionTip = "请输姓名";
                return false;
            }
            else if (!(/[\u4E00-\u9FA5]{2,5}(?:·[\u4E00-\u9FA5]{2,5})*/.test(_self.QuickResvIntentionInfo.docname))) {
                tipBox.style.display = "block";
                _self.sResvIntentionTip = "请输入正确的姓名";
                return false;
            }

            _self.$http.post("/Order/ResvIntentionQuickAdd",
                {
                    username: username, usermobile: usermobile, docname: docname
                }).then(
                function (res) {
                    alert("快速预约成功");
                    _self.showQkRe = false;
                    tipBox.style.display = "none";
                    _self.sResvIntentionTip = "";
                    _self.QuickResvIntentionInfo.username = "";
                    _self.QuickResvIntentionInfo.usermobile = "";
                    _self.QuickResvIntentionInfo.docname = "";
                });
        },
        hiddenDeleteIcon: function ($event) {
            if ($event.target.value == "") {
                $event.target.nextElementSibling.style.visibility = "hidden";
            } else {
                $event.target.nextElementSibling.style.visibility = "visible";
            }            
        },
        SuggestQuickAdd: function () {
            var _self = this;
            var tipBox = document.getElementById("tipBox");
            tipBox.style.display = "none";

            var suggestcomments = _self.SuggestInfo.suggestcomments;
            var suggesttername = _self.SuggestInfo.suggesttername;
            var suggesttermobile = _self.SuggestInfo.suggesttermobile;
            _self.errorType = -1; //每次初始化错误类型
            if (_self.SuggestInfo.suggestcomments == null || _self.SuggestInfo.suggestcomments == "") {
                tipBox.style.display = "block";
                _self.sSuggestTip = "请输入留言";
                _self.errorType = 0;
                return false;
            }
            else if (!(/[\u4E00-\u9FA5]{2,5}(?:·[\u4E00-\u9FA5]{2,5})*/.test(_self.SuggestInfo.suggesttername))) {
                tipBox.style.display = "block";
                _self.sSuggestTip = "请输入正确的姓名";
                return false;
            }
            else if (_self.SuggestInfo.suggesttermobile == null || _self.SuggestInfo.suggesttermobile == "") {
                tipBox.style.display = "block";
                _self.sSuggestTip = "请输手机号或邮箱";
                return false;
            }
            else if (!(/(^1[0-9]{10}$)|(^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$)/.test(_self.SuggestInfo.suggesttermobile))) {
                tipBox.style.display = "block";
                _self.sSuggestTip = "请输入正确格式的手机号码或邮箱";
                return false;
            }

            _self.$http.post("/Order/SuggestQuickAdd",
                {
                    suggestcomments: suggestcomments, suggesttername: suggesttername, suggesttermobile: suggesttermobile
                }).then(
                function (res) {
                    alert("投诉建议提交成功");
                    _self.showSuggest = false;
                    tipBox.style.display = "none";
                    _self.sSuggestTip = "";
                    _self.SuggestInfo.suggestcomments = "";
                    _self.SuggestInfo.suggesttername = "";
                    _self.SuggestInfo.suggesttermobile = "";
                });
        }
    },
    template: '<div class="clinic-right-sidebar">' +
    '<div class="sidebar-btn-list">' +
        '<div class="sidebar-btn" v-on:click="BackToTop()">' +
            '<img src="/styles/image/right1.png">' +
            '<div>顶部</div>' +
        '</div>' +
        '<div id="QkResv" class="sidebar-btn" @click="showQkRe = true">' +
            '<img src="/styles/image/right2.png">' +
            '<div>预约</div>' +
        '</div>' +
        '<div class="sidebar-btn sidebar-code-right">' +
            '<img src="/styles/image/right3.png">' +
            '<div>扫扫</div>' +
            '<img class="sidebar-code" src="/styles/image/clinic_r.png">' +
        '</div>' +
        '<div class="sidebar-btn" @click="showSuggest = true">' +
            '<img src="/styles/image/right4.png">' +
            '<div>建议</div>' +
        '</div>' +
    '</div>' +
    '<div class="background-cloth" v-if="showQkRe || showSuggest"></div>' +
    '<div class="sidebar-dialog quick-reserve" v-if="showQkRe">' +
        '<div class="out-title">' +
            '<div class="inner-title">快速预约<i class="close-dialog" v-on:click="CloseQkRe()"></i></div>' +
        '</div>' +
        '<div class="qk-re-notice">' +
            '<p>预约申请提交后，我们的工作人员会在收到后的第一时间联系您</p>' +
            '<p>请保持手机畅通，谢谢</p>' +
        '</div>' +
        '<div class="tipBox" id="ResvIntentiontipBox">' +
        '<p class="addImgTip" style="text-align: center;color: red;">{{sResvIntentionTip}}</p>' +
        '</div>' +
        '<div class="input-box">' +
        '<div class="input-title quick-title">您的名字：</div>' +
        '<div class="input-value quick-value" :class="[errorType == 2 ? \'error-input\' : \'\']">' +
        '<input id="ResvName" v-model="QuickResvIntentionInfo.username" placeholder="您的名字" type="text" maxlength="15" v-on:input="hiddenDeleteIcon($event)">' +
        '<i class="delete_icon" v-on:click="DeleteItem(ResvName)" style="visibility: hidden;"></i>' +
        '</div>' +
        '</div>' +
        '<div class="input-box">' +
        '<div class="input-title quick-title">手机号码：</div>' +
        '<div class="input-value quick-value"  :class="[errorType == 3 ? \'error-input\' : \'\']">' +
        '<input id="ResvUserMobile" v-model="QuickResvIntentionInfo.usermobile" placeholder="手机号" type="tel" maxlength="11" v-on:input="hiddenDeleteIcon($event)">' +
        '<i class="delete_icon" v-on:click="DeleteItem(ResvUserMobile)" style="visibility: hidden;"></i>' +
        '</div>' +
        '</div>' +
        '<div class="input-box">' +
        '<div class="input-title quick-title">预约专家名称：</div>' +
        '<div class="input-value quick-value">' +
        '<input id="ResvDocName" v-model="QuickResvIntentionInfo.docname" placeholder="专家姓名" type="text" maxlength="15" v-on:input="hiddenDeleteIcon($event)">' +
        '<i class="delete_icon" v-on:click="DeleteItem(ResvDocName)" style="visibility: hidden;"></i>' +
        '</div>' +
        '</div>' +
        '<div class="confirm-btn qk-re-btn" v-on:click="ResvIntentionQuickAdd">提交预约</div>' +
    '</div>' +
    '<div class="sidebar-dialog customer-suggest" v-if="showSuggest">' +
        '<div class="out-title">' +
            '<div class="inner-title">投诉建议' +
                '<i class="close-dialog"  v-on:click="CloseSuggest()"></i>' +
            '</div>' +
        '</div>' +
        '<div class="tipBox" id="tipBox">' +
        '<p class="addImgTip" style="text-align: center;color: red;">{{sSuggestTip}}</p>' +
        '</div>' +
        '<p class="suggest-notice">瑞慈诊所欢迎每一位用户对我们的服务进行监督并提出宝贵的意见</p>' +
        '<div class="suggest-content">' +
            '<p>您可以：</p>' +
            '<p>1、拨打我们的全国服务专线：4001-108-102</p>' +
            '<p>2、请给我们留言，我们将在2个工作日内给予回复，非常感谢对瑞慈诊所的督促和支持！</p>' +
            '<p>3、请给我们留言' +

                '<div class="textarea-box">' +
                    '<div class="textarea-title suggest-title">留言内容：</div>' +
                    '<div class="textarea-value suggest-value" :class="[errorType == 0 ? \'error-input\' : \'\']">' +
                        '<textarea class="value" id="SuggestComments" v-model="SuggestInfo.suggestcomments"  placeholder="请输入您的宝贵意见" v-on:input="hiddenDeleteIcon($event)"></textarea>' +
                        '<i class="delete_icon" v-on:click="DeleteItem(SuggestComments)" style="visibility: hidden;"></i>' +
                    '</div>' +
                '</div>' +
                '<div class="input-box">' +
                    '<div class="input-title suggest-title">您的名字：</div>' +
                    '<div class="input-value suggest-value">' +
                        '<input placeholder="名字" id="SuggestName" v-model="SuggestInfo.suggesttername" type="text" v-on:input="hiddenDeleteIcon($event)">' +
                        '<i class="delete_icon" v-on:click="DeleteItem(SuggestName)" style="visibility: hidden;"></i>' +
                    '</div>' +
                '</div>' +
                '<div class="input-box">' +
                    '<div class="input-title suggest-title">联系方式：</div>' +
                    '<div class="input-value suggest-value">' +
                        '<input placeholder="手机号/邮箱" id="SuggestterMobile" v-model="SuggestInfo.suggesttermobile" type="text" v-on:input="hiddenDeleteIcon($event)">' +
                        '<i class="delete_icon" v-on:click="DeleteItem(SuggestterMobile)" style="visibility: hidden;"></i>' +
                    '</div>' +
                '</div>' +
                '<div class="confirm-btn ct-sg-btn" v-on:click="SuggestQuickAdd">提交建议</div>' +
            '</p>' +
        '</div>' +
    '</div>' +
    '</div>'
});
//意见投诉弹窗
var suggestDialog = Vue.extend({
    props: [],
    methods: {},
    template: '<div class="sidebar-dialog customer-suggest">' +
    '<div class="out-title">' +
        '<div class="inner-title">投诉建议' +
            '<i class="close-dialog" @click="showSuggest = false"></i>' +
        '</div>' +
    '</div>' +
    '<p class="notice">瑞慈诊所欢迎每一位用户对我们的服务进行监督并提出宝贵的意见</p>' +
    '<div class="content">' +
        '<p>您可以：</p>' +
        '<p>1、拨打我们的全国服务专线：4001-108-102</p>' +
        '<p>2、请给我们留言，我们将在2个工作日内给予回复，非常感谢对瑞慈诊所的督促和支持！</p>' +
        '<p>3、请给我们留言' +
            '<div class="textarea-box">' +
                '<div class="textarea-title suggest-title">留言内容：</div>' +
                '<div class="textarea-value suggest-value">' +
                    '<textarea class="value"  placeholder="请输入您的宝贵意见"></textarea>' +
                '</div>' +
            '</div>' +
            '<div class="input-box">' +
                '<div class="input-title suggest-title">您的名字：</div>' +
                '<div class="input-value suggest-value">' +
                    '<input placeholder="名字" type="text">' +
                    '<i class="delete_icon"></i>' +
                '</div>' +
            '</div>' +
            '<div class="input-box">' +
                '<div class="input-title suggest-title">联系方式：</div>' +
                '<div class="input-value suggest-value">' +
                    '<input placeholder="手机号/邮箱" type="text">' +
                    '<i class="delete_icon"></i>' +
                '</div>' +
            '</div>' +
            '<div class="confirm-btn ct-sg-btn">提交建议</div>' +
        '</p>' +
    '</div></div>'
});

//诊所标准底部
var clinicFoot = Vue.extend({
    props: [],
    methods: {},
    template: '<div class="clinic-foot">' +
    '<div class="inner-foot">' +
        '<div class="logo">' +
            '<img src="/styles/image/clinic_logo.png">' +
        '</div>' +
        '<div class="clinic-info">' +
            '<p>地点：上海市静安区江宁路212号3F</p>' +
            '<p>总机电话：021-62585075</p>' +
            '<p>全国服务热线：4001-108-102</p>' +
        '</div>' +
        '<div class="copy-right">' +
            '<div style="text-align: right">' +
                '<span class="copy-right-detail"><a class="link" href="/AboutUs/Index">关于我们</a></span> |' +
                '<span class="copy-right-detail"><a class="link" href="/AboutUs/Index?TabId=10&first=1&second=0">隐私政策</a></span> |' +
                '<span class="copy-right-detail"><a class="link" href="/AboutUs/Index?TabId=11&first=1&second=1">版权说明</a></span>' +
            '</div>' +
            '<div class="copy">沪ICP备15049800号-1 瑞慈健康体检全国连锁机构版权所有COPYRIGHT ©2015 TG.COM.CN ALL RIGHTS RESERVED</div>' +
        '</div>' +
    '</div></div>'
});
//预约流程
var clinicProcess = Vue.extend({
    props: [],
    methods: {},
    template: '<div class="clinic-process">' +
    '<h1 class="clinic-process-title">精准预约的流程</h1>' +
    '<div class="clinic-process-list">' +
        '<p>申请精准预约，选择期望的专家医生。</p>' +
        '<p>在对应的专家排班表里选择就诊时间</p>' +
        '<p>选择希望前往的地区诊所就诊</p>' +
        '<p>填写真实有效的预约信息，以便我们的客服确认信息</p>' +
        '<p>诊所客服电话联系，确认就诊信息</p>' +
    '</div></div>'
});
//左边tab切换
var clinicLeftTab = Vue.extend({
    props: ['tab'],
    methods: {
        changeTab: function (p_index, p_key, p_id, p_category) {
            this.$emit('changetab', { first: p_index, second: p_key, id: p_id, category: p_category })
        }
    },
    template: '<div class="clinic-left-tab">' +
        '<div class="tab-title">{{tab.title}}' +
            '<div class="line-one"></div>' +
        '</div>' +
        '<div class="tab-group" v-for="(list, index) in tab.tabList">' +
            '<p class="tab" :class="item.cls" v-for="(item, key) in list.list" @click="changeTab(index, key, item.id, item)">{{item.title}}</p>' +
            '<div class="line-one"></div>' +
        '</div>' +
    '</div>'
});

//公用分页组件
var clinicPage = Vue.extend({
    props: ['pageParam'],
    data: function () {
        return {
            active: 'pageActive',
            inactive: ''
        }
    },
    computed: {
        indexs: function () {
            var _self = this;
            var left = 1;
            var right = _self.pageParam.pageCount;
            var array = [];

            if (_self.pageParam.curPage < 1)
                _self.pageParam.curPage = 1;

            if (_self.pageParam.curPage > _self.pageParam.pageCount)
                _self.pageParam.curPage = _self.pageParam.pageCount;

            if (_self.pageParam.pageCount > 4) {
                if (_self.pageParam.curPage > 4 && _self.pageParam.curPage < _self.pageParam.pageCount - 4) {
                    left = _self.pageParam.curPage - 2;
                    right = _self.pageParam.curPage + 2;
                } else {
                    if (_self.pageParam.curPage <= 4) {
                        left = 1;
                        right = 5;
                    } else {
                        right = _self.pageParam.pageCount;
                        left = _self.pageParam.pageCount - 4;
                    }
                }
            }
            if (_self.pageParam.pageCount >= 4) {
                if (left > 2) {
                    array.push(1);
                    array.push(0);
                }
                while (left <= right) {
                    array.push(left);
                    left++;
                }
                if (right < _self.pageParam.pageCount) {
                    array.push(0);
                    array.push(_self.pageParam.pageCount)
                }
            }
            else {
                while (left <= right) {
                    array.push(left);
                    left++;
                }
            }

            return array;
        }
    },
    methods: {
        btnClick: function (p_curPage) {//页码点击事件
            var _self = this;
            if (p_curPage != _self.pageParam.curPage) {
                _self.pageParam.curPage = p_curPage;
                _self.pageParam.page_func(_self.pageParam.curPage, _self.pageParam.pageInfo);
            }
            else {
                var totalcount = _self.pageParam.pageCount + 1;
                if (_self.pageParam.curPage >= 1 && p_curPage != totalcount)
                    _self.pageParam.page_func(_self.pageParam.curPage, _self.pageParam.pageInfo);
            }
        }
    },
    template: '<div class="clinic-page-box" id="clinic-page-box">' +
        '<div class="clinic-page">' +
            '<ul>' +
                '<li class="indexBtn" @click="btnClick(1)">首页</li>' +
                '<li @click="btnClick(--_self.pageParam.curPage)"><</li>' +
                '<li v-for="index in indexs" :class="[_self.pageParam.curPage == index ? active : inactive]" @click="btnClick(index)" v-if="index">{{index}}' +
                '<li v-else>...</li>' +
                '<li @click="btnClick(++_self.pageParam.curPage)">></li>' +
                '<li class="lastBtn" @click="btnClick(_self.pageParam.pageCount)">末页</li>' +
            '</ul>' +
        '</div>' +
    '</div>'
});

//带按钮弹窗
var dialogConfirm = Vue.extend({
    props: ['param'],
    template: '<div class="dialog-confirm" v-if="param.type">' +
        '<div class="black-cloth"></div>' +
        '<div class="dialog-confirm-inner">' +
            '<div class="head">' +
                '<p class="title">温馨提示' +
                '<i class="confirm-close" @click="param.type=false"></i></p>' +
            '</div>' +
            '<div class="dialog-confirm-message" v-html="param.text"></div>' +
            '<div class="btn" v-if="param.showBtn == 2">' +
                '<span class="btn-left common-confirm-btn" @click="param.left_func">{{param.l_val}}</span>' +
                '<span class="btn-right common-confirm-btn" @click="param.type=false">{{param.r_val}}</span>' +
            '</div>' +
            '<div class="btn" v-if="param.showBtn == 1">' +
                '<span class="btn-middle common-confirm-btn" @click="param.left_func">{{param.l_val}}</span>' +
            '</div>' +
        '</div>' +
    '</div>'
});
//预约成功弹窗
var orderSuccessDialog = Vue.extend({
    props: ['param'],
    methods: {
        toExpert: function () {
            window.location.href = "../ExpertDetail/Index?doctorid=" + this.param.doctorId;
        }
    },
    template: '<div class="order-success-dialog" v-if="param.show">' +
        '<div class="black-cloth"></div>' +
        '<div class="order-success-dialog-inner">' +
            '<div class="osd-head">' +
                '<p class="osd-title">恭喜预约成功' +
                '<i class="confirm-close" @click="toExpert"></i></p>' +
            '</div>' +
            '<div class="order-success-dialog-message">' +
                '<p class="osd-message">请保持手机畅通，我们的客服会尽快和您取得联系，确认您的预约。</p>' +
                '<p class="osd-message">您本次进行的是<a class="message-link" href="javascript:void(0)">门诊预约</a>，费用当天到诊所前台缴纳。</p>' +
            '</div>' +
            '<div class="osd-order-info">' +
                '<div class="info-detail"><p>就诊时间：</p><p>{{param.date}}</p></div>' +
                '<div class="info-detail"><p>预约专家：</p><p>{{param.expertName}}</p></div>' +
                '<div class="info-detail"><p>就诊医院：</p><p>{{param.hospital}}</p></div>' +
                '<div class="info-detail"><p>就诊地点：</p><p>{{param.address}}</p></div>' +
                '<div class="info-detail"><p>就诊费用：</p><p style="color: red">{{param.fee}}元</p></div>' +
            '</div>' +
            '<div class="osd-hot-line"><a href="javascript:void(0)">客服电话：4001-108-102</a></div>' +
        '</div>' +
    '</div>'
});
//搜索
var search = Vue.extend({
    props: ['searchParam'],
    methods: {
        searchContent: function () {//页码点击事件
            var _self = this;
            var keyText = document.getElementById("keyText");
            this.$emit('search', keyText.value)
        }
    },
    template: '<div class="common-search">' +
        '<div class="search-content">' +
            '<input type="text" id="keyText">' +
        '</div>' +
        '<div class="search-btn" @click="searchContent()">搜索</div>' +
    '</div>'
});
